    
<% if($('#usertype').val()=='D'){%>
	<% _.each(feeds, function(feed){ %>
		<%if(feed.get("attended")=="Y"){%>
				<p><span class="patient"><%= feed.get("patient").name %></span> had an appointment
				on <span class="date"><%= new Date(feed.get("dateOfAppointment")).format("dd mmm yyyy") %> </span>. 
				Please click <span class="docappointmentprint"   id="<%= feed.get("id") %>" >here</span> to view.
				<span class="time"><%= feed.get("appointmentTime")!=null?fomartTimeShow( feed.get("appointmentTime")):null %></span></p>
		
		<%}else if(feed.get("dateOfAppointment") !=null){%>
				<p><span class="patient"><%= feed.get("patient").name %></span> has scheduled an appointment
				on <span class="date"><%= new Date(feed.get("dateOfAppointment")).format("dd mmm yyyy") %> </span>. 
				Please click <span class="docappointment"   id="<%= feed.get("id") %>" >here</span> to view.
				<span class="time"><%= feed.get("appointmentTime")!=null?fomartTimeShow( feed.get("appointmentTime")):null%></span>
				<%if(feed.get("paymentStatus")=="Y"){%>
					<span class="paid"></span>
				<%}else if(feed.get("paymentStatus")=="W"){%>
					<span class="waiver"></span>
				<%}else {%>
					<span class="unpaid"></span>
				<%}%>
				</p>
		<%}else{%>
				<p><span class="patient"><%= feed.get("patient").name %></span> has been referred to you by
					<span class="patient">Dr. <%= feed.get("referringDoctor").name %></span>.
				</p>		
		<%}%>
	  <% }); %>
<% }else  if($('#usertype').val()=='P'){ %>
	<% _.each(feeds, function(feed){ %>
			<%if(feed.get("dateOfAppointment") !=null){%>
			<p>Your appointment with <span class="patient">Dr. <%= feed.get("doctor").name %></span> on
						<span class="date"><%= new Date(feed.get("dateOfAppointment")).format("dd mmm yyyy") %></span>
						<% if(feed.get("attended")=="Y"){ %>
							. Please click <span class="patappointment"  id="<%= feed.get("id") %>">here</span> to check your diagnosis.
						<%}else if( feed.get("sessionId")){%>
							. Please click <span class="patvideoappointment"  id="<%= feed.get("id") %>">here</span> to start video session.
						<%}else if(new Date(feed.get("dateOfAppointment")).compare(new Date()) == 0 && feed.get("video")== "Y"){%>
							. Video session has not been initiated yet.
						<%}  %>
						<% if(feed.get("problem") !=null){%>
							You can check your precare <span class="patcareappointment"  id="<%= feed.get("problem").id %>">here.</span> 
						<%}%>
					<span class="time"><%= fomartTimeShow( feed.get("appointmentTime")) %></span>
				</p>

			<%}else{%>
					<p>You have been referred by Dr. <span class="patient"><%= feed.get("referringDoctor").name %></span> to 
						Dr. <span class="patient"><%= feed.get("doctor").name %></span> Please click
						<span class="patrefappointment"  data="<%=feed.get('doctor').id%>" hospital ="<%=feed.get('hospital')!=null?feed.get('hospital').id:null%>" 
						id="<%= feed.get("id") %>">here</span> to schedule an appointment.
						<% if(feed.get("problem") !=null){%>
							You can check your precare <span class="patcareappointment"  id="<%= feed.get("problem").id %>">here.</span> 
						<%}%>
												 
					</p>
			<%}%>

	  <% }); %>

<% }else  if($('#usertype').val()=='L') { %>
	<% _.each(feeds, function(feed){ %>
			<%if(lastUpdated ==null || lastUpdated > feed.get("updatedOn")){%>
					<p>New report has been referred to your lab by Dr. <span class="patient"><%= feed.get("doctor").name %></span> on
							<span class="date"><%= new Date(feed.get("dateOfAppointment")).format("dd mmm yyyy") %></span>
								. Please click <span class="labtest"  id="<%= feed.get("id") %>">here</span> to check update the test.
						<span class="time"><%= feed.get("appointmentTime")!=null?fomartTimeShow( feed.get("appointmentTime")):null %></span>
					</p>
			<%}else{%>
					<p style="background: lightgray">New report has been referred to your lab by Dr. <span class="patient"><%= feed.get("doctor").name %></span> on
							<span class="date"><%= new Date(feed.get("dateOfAppointment")).format("dd mmm yyyy") %></span>
								. Please click <span class="labtest"  id="<%= feed.get("id") %>">here</span> to check update the test.
						<span class="time"><%= feed.get("appointmentTime")!=null?fomartTimeShow( feed.get("appointmentTime")):null %></span>
					</p>
			<%}%>
	  <% }); %>
<%}%>
	 
